{__NOLAYOUT__}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>index</title>
    <link href="__STATIC__/www/css/mui.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="__STATIC__/www/css/basic.css" />
    <link rel="stylesheet" type="text/css" href="__STATIC__/www/css/send.css"/>
    
</head>
<body>
	<div class="section1 mui-clearfix">
		<header class="mui-bar mui-bar-nav" >
			<a class="mui-icon mui-icon-left-nav mui-pull-left" href="javascript:history.back(-1)" style="color: #3474FA;"></a>
			<!--<h1 class="mui-title">login</h1>-->
			<a class="mui-icon mui-pull-right right1" href="javascript:;"></a>
		</header>
	</div>
	<div class="section2">
		<div class="container mui-clearfix">
			<p class="p1">H链 发送</p>
			<p class="p2"><img src="__STATIC__/www/images/icon_hc_03.png"/></p>
		</div>
	</div>
	<div class="section3">
		<div class="container mui-clearfix">
			<form action="" method="post" method="" id="submit">
				<div class="f1">
					<input type="text" name="accounts" id="accounts" placeholder="钱包地址" />
					<img src="__STATIC__/www/images/send_icon_qr_code.png" alt="" class="im1"/>
				</div>
				<div class="f1">
					<input type="text" name="balance" id="balance" placeholder="交易金额" />
				</div>
				<div class="f2 mui-clearfix">
					<p class="p1"><img src="__STATIC__/www/images/icon_total.png"/> <span>可用数量：{$hlink} H链</span></p>
					<!--<p class="p2"><a href="javascript:;">最大数量</a></p>-->
				</div>
				<div class="f1">
					<input type="text" name="remark" id="remark" placeholder="备注" value="转出"/>
				</div>
				<div class="sub">
					<input id="btn" type="button" value="发送"/>
				</div>
				
			</form>
		</div>
	</div>
	
		
	
	<div class="kong"></div>
	
</body>
<script src="__STATIC__/www/js/mui.min.js"></script>
<script src="__STATIC__/www/js/jquery.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
	mui.init();
	$("#btn").click(function(){
        /*验证表单*/
        var max="{$hlink}";
        var accounts=$("#accounts").val();
        var balance=$("#balance").val();
        var remark=$("#remark").val();
        if(accounts.length<0)
        {
            mui.toast("地址不能为空！");
            return false;
        }
        if(balance.length<0||balance==0)
        {
            mui.toast("转出金额必须大于0！！");
            return false;
        }
        if(remark.length<0)
        {
            mui.toast("请填写备注！");
            return false;
        }
        // if(balance>max)
        // {
        //     mui.toast("您的链币不够！");
        //     return false;
        // }
        var url="{:url('Money/sendMoney')}";
        var jump="/Money/index";
        $.post(url,{accounts:accounts,balance:balance,remark:remark},function(data){
            var data=JSON.parse(data);
            if(data.status==0)
            {
                mui.alert("操作成功！","提示",function(){
                    window.location.href=jump;
				});
            }else{
                mui.toast(data['info']);
            }
        })
	})

	$(function(){
	    var accounts="{$accounts}";
	    if(accounts!=""&&accounts!=null)
	    {
			$("#accounts").val(accounts);
		}
	})

	/*调起扫描*/
	$('.im1').click(function(){
        android.capture();
	})
	/*扫描之后返回结果*/
	function setaccounts(data){
	    $("#accounts").val(data);
	}
</script>
</html>